<%@page import="java.util.List"%>
<%@page import="com.baozun.model.TUser"%>
<%@page import="com.baozun.util.CommonConst"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Static &amp; Dynamic Tables" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../css/style.css" />
<link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="../assets/css/font-awesome.min.css" />

<!--[if IE 7]>
		  <link rel="stylesheet" href="../assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

<!-- page specific plugin styles -->

<link rel="stylesheet"
	href="../assets/css/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" href="../assets/css/chosen.css" />
<link rel="stylesheet" href="../assets/css/colorpicker.css" />

<!-- fonts -->

<link rel="stylesheet" href="../assets/css/font.css" />

<!-- ace styles -->

<link rel="stylesheet" href="../assets/css/ace.min.css" />
<link rel="stylesheet" href="../assets/css/ace-rtl.min.css" />
<link rel="stylesheet" href="../assets/css/ace-skins.min.css" />
<style type="text/css">
html {
	width: 100%;
	height: 100%;
	background: #fff;
}

body {
	background: #fff;
}

.modal_box {
	width: 100%;
	height: auto;
	min-height: 260px;
	margin: 0 auto;
	padding: 20px 0 10px 0;
}

.modal_btn {
	margin-top: 20px;
}

.modal_btn a {
	margin: 0 10px;
}
</style>
</head>
<%
TUser user = (TUser)session.getAttribute(CommonConst.SESSION_USER);
List<TUser> userList = (List<TUser>)request.getAttribute("userList");
%>
<body>
	<div class="row">
		<div class="col-xs-12">
			<form class="form-inline" id="friend_add_form" name="friend_add_form"
				method="post" target="detail">
				<div class="modal_box">
					<table class="table table-striped table-bordered table-hover">
						<tr>
							<td class="center">用户姓名</td>
							<td><select multiple="" class="col-xs-12 chosen-select"	id="form-field-select-4" name="stUserIdResponse" data-placeholder="选择用户">
									<%
									    for(TUser userSingle:userList){
									%>
									<option value="<%=userSingle.getStUserId()%>"><%=userSingle.getStName()%></option>
									<%
									    }
									%>
							</select></td>
						</tr>
						<tfoot>
							<tr>
								<td colspan="2"><p class="modal_btn">
										<a href="javascript:;" class="btn btn-primary btn_bs"
											onclick="saveFriend()">保 存</a> <a
											href="javascript:closeWindow()" class="btn">取 消</a>
									</p></td>
							</tr>
						</tfoot>
					</table>
				</div>
			</form>
		</div>
		<!-- 关键点1 -->
		<iframe name="detail" style="width: 100%; height: 800; display: none"></iframe>
	</div>
	<script type="text/javascript" src="../assets/js/jquery-2.0.3.min.js"></script>
	<script type="text/javascript" src="../assets/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../assets/js/jquery.ui.touch-punch.min.js"></script>
	<script type="text/javascript" src="../assets/js/chosen.jquery.min.js"></script>
	<script type="text/javascript" src="../assets/js/bootstrap-tag.min.js"></script>
	<script type="text/javascript" src="../assets/js/ace.min.js"></script>
	<script type="text/javascript" src="../js/artDialog/artDialog.source.js?skin=default"></script>
	<script type="text/javascript" src="../js/artDialog/plugins/iframeTools.source.js"></script>
	<script type="text/javascript" src="../js/openDialog.js"></script>
	<script type="text/javascript" src="../js/openDialogcustom.js"></script>
	<script>
		jQuery(function($) {
			$(".chosen-select").chosen();

		});
		//提交返回操作
		function workLater() {
			closeWindow(); // 必须写在“art.dialog.opener.querypross();”之前
			art.dialog.opener.process();
		}
		function saveFriend() {
			var stUserIdArray = $("#form-field-select-4").val();
			//如果姓名和单位都不为空，则可以提交
			if (stUserIdArray != null && "" != stUserIdArray) {
				document.friend_add_form.action = "friend_add_submit";
				document.friend_add_form.submit();
			} else {
				alert("待添加好友数为零！");
			}
		}
	</script>
</body>
</html>